#ifndef BOOK_PARAGRAPH_TEXT_H
#define BOOK_PARAGRAPH_TEXT_H

#include "base.h"
#include <QString>
#include <qtextformat.h>

namespace Book
{

namespace Paragraph
{

class Text : public Base
{
    public:

        explicit
        Text (const QTextCharFormat& _format)
            : m_CharFormat(_format) {}

        Text (const QTextCharFormat& _format, const QString& _txt)
            : m_CharFormat(_format), m_Text(_txt) {}

        void AddText (const QString& _txt)
            { m_Text += _txt; }

        const QString& GetText () const
            { return m_Text; }

        const QTextCharFormat& GetCharFormat () const
            { return m_CharFormat; }

        virtual void Visit (Visitor& _visitor) const;

    private:

        const QTextCharFormat m_CharFormat;

        QString m_Text;
};

}

}

#endif // BOOK_PARAGRAPH_TEXT_H
